
#杨辉三角形， 自己写了一个巨复杂的解法。
def trangle(count):
    i=0
    L=list(list(range(x)) for x in range(1,count+1) )
    L[0]=[1]
    yield L[0]
    i=i+1
    while i<count:
        list1=L[i-1]
        list2=L[i]
        for j in  range(1,len(list1)):
            list2[j]=list1[j-1]+list1[j]
        list2[0]=1
        list2[-1]=1
        i=i+1
        yield  list2


def trangle2():
    L = [1]
    while True:
        N = L[:]
        yield N
        L.append(0)
        L = [L[i - 1] + L[i] for i in range(len(L))]
n=0
for t in trangle(10):
    print (t)
    n=n+1
    if n>10:
        break